home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / comm / tifpro2.zip / THEINVE.WAS < prev    next >
Text File  |  1996-04-19  |  3KB  |  123 lines

  1. #define _SEARCHSTR "Your_Ipaddress:"
  2.  
  3. integer iOriginalMode = 0
  4.  
  5. proc main
  6.  
  7.    when USEREXIT call ManualLogon
  8.    when $RMOUSESTATE call CheckLeftMouseState
  9.    
  10.    iOriginalMode = $PWMODE
  11.    
  12.    statmsg "Click right and left mouse buttons simultaneously for manual logon..."
  13.    
  14.    transmit "^M"
  15.    ISPLogon()
  16.    
  17.    pause 5
  18.    
  19. endproc
  20.  
  21. proc CheckLeftMouseState
  22.    when $RMOUSESTATE SUSPEND
  23.    if $LMOUSESTATE
  24.       ManualLogon()
  25.    else
  26.       when $RMOUSESTATE RESUME
  27.    endif
  28. endproc
  29.  
  30. proc ManualLogon
  31.    when USEREXIT SUSPEND
  32.    when $RMOUSESTATE SUSPEND
  33.  
  34.    if $PWMODE != 0         ;if in a mode other than TERMINAL mode
  35.       usermsg "In order to logon manually PROCOMM PLUS must switch to terminal mode for logon.  PROCOMM PLUS will switch back to this mode after logon."
  36.       pwmode TERMINAL
  37.    endif   
  38.    
  39.    statclear
  40.    
  41.    when ISKEY 1 0x1B call ExitSuccess  ;if user presses <Esc>
  42.    
  43.    for i3 = 45 DOWNTO 0
  44.       statmsg "Press <Esc> after logging on.  Time remaining:  %d seconds" i3
  45.       pause 1
  46.    endfor
  47.    
  48.    ExitSuccess()
  49. endproc
  50.  
  51. proc ExitSuccess
  52.  
  53.    statclear
  54.    
  55.    if iOriginalMode != $PWMODE
  56.       pwmode iOriginalMode
  57.       mspause 500
  58.       sendkey ALT 'N'            ;press NO button on "disconnect" dialog
  59.    endif
  60.    
  61.    pause 2
  62.    
  63.    exit 0         ;exit with SUCCESS code (0)
  64. endproc
  65.  
  66.  
  67. ;  ISPLogon
  68. ;  Internet Service Provider logon procedure for The Invention Factor.
  69. proc ISPLogon
  70.    string szLogonName = $NULLSTR
  71.    string szPassword = $NULLSTR
  72.    string szLine, szIPAddress, szIPGateway
  73.    string szINIFile = $WINPATH
  74.    integer Position, StrLength
  75.  
  76.    fetch internet logonname szLogonName
  77.    fetch internet password szPassword
  78.    fetch internet gatewayaddress szIPGateway
  79.  
  80.    transmit "^M"
  81.  
  82.    waitfor "Enter Language # to use (Enter)=no chan" 30
  83.    pause 1
  84.    transmit "3^M"
  85.    waitfor "Do you want graphics" 30
  86.    pause 1
  87.    transmit "n^M"
  88.    waitfor "What is your first na" 30
  89.    pause 1
  90.    transmit szLogonName
  91.    transmit "^M"
  92.    pause 1
  93.    transmit "Y"
  94.    waitfor "Is this correc" 30
  95.    pause 1
  96.    transmit "^M"
  97.    waitfor "Password (Dots will echo)? " 30
  98.    pause 1
  99.    transmit szPassword
  100.    transmit "^M"
  101.    waitfor "Now"
  102.    snapshot FILE "C:\PWTEMP.TXT"
  103.    fopen 0 "C:\PWTEMP.TXT" READ TEXT
  104.    while not feof 0
  105.       fgets 0 szLine
  106.       if strfind szLine _SEARCHSTR Position
  107.          strlen _SEARCHSTR StrLength
  108.          Position = Position + StrLength
  109.          szIPAddress = szLine
  110.          strdelete szIPAddress 0 Position
  111.          strextract szIPAddress szIPAddress " " 0
  112.          addfilename szINIFile "SUPERTCP.INI"
  113.          profilewr szINIFile "kernel" "IPAddress" szIPAddress
  114.          profilewr szINIFile "kernel" "IPGateway" szIPGateway
  115.          profilewr szINIFile "interfaces" "IPAddress1" szIPAddress
  116.          exitwhile
  117.       endif
  118.    endwhile
  119.    fclose 0
  120.    delfile "C:\PWTEMP.TXT"
  121. endproc
  122.  
  123.